package cn.itcast.nems.studentrecord.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 转班凭单批量导入
 * </p>
 * @author czq
 * @since 2024-03-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("e2_journal_transfer_batch_import")
public class JournalTransferBatchImport implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 凭单类型
     */
    private String journalType;

    /**
     * 操作类型
     */
    private String operatorType;

    /**
     * 业务原因
     */
    private String bizReason;

    /**
     * 凭单办理日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime bizDate;

    /**
     * 是否特殊申请
     */
    private String specialFlag;

    /**
     * 备注
     */
    private String remark;

    /**
     * 发起人邮箱
     */
    private String creatorEmail;

    /**
     * 转出学籍ID
     */
    private String originStudentRecordId;

    /**
     * 转班学籍出班日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime originClazzOutDate;

    /**
     * 转出学籍应服务天数
     */
    private Integer originClazzServiceDays;

    /**
     * 转出学籍实际服务天数
     */
    private Integer originClazzSettlementDays;

    /**
     * 转出学籍课耗金额
     */
    private Integer originClazzSettlementAmount;

    /**
     * 转出学籍转出金额
     */
    private Integer originTransferOutAmount;

    /**
     * 转入学籍老EMS学籍ID（如有）
     */
    private Integer targetJoinclassId;

    /**
     * 转入学籍班级ID
     */
    private String targetClazzId;

    /**
     * 转入学籍入班日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime targetClazzInDate;

    /**
     * 转入班级应付金额
     */
    private Integer targetAmountDue;

    /**
     * 转入班级优惠金额
     */
    private Integer targetDiscountAmount;

    /**
     * 转入班级转入金额
     */
    private Integer targetTransferFromAmount;

    /**
     * 转入班级优惠ID列表
     */
    private String targetDiscountIds;

    /**
     * 处理状态;枚举值：待处理｜PENDING、已完成｜FINISHED、处理失败｜FAILED
     */
    private String processState;

    /**
     * 处理结果说明
     */
    private String processDescription;

    /**
     * 处理重试次数
     */
    private Integer processRetriesNumber;
    
    /**
     * 处理完成后生成的凭单ID；转班、转待定、休学凭单的id
     */
    private String processJournalId;

    /**
     * 租户ID;与itcast_cloud.sys_client.tenant_id一致
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer tenantId;

    /**
     * 子租户ID
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer subtenantId;

    /**
     * 创建人;存储工作邮箱
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdDatetime;

    /**
     * 最后修改人;存储工作邮箱
     */
    @TableField(fill = FieldFill.UPDATE)
    private String modifiedBy;

    /**
     * 最后修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime modifiedDatetime;

    /**
     * 删除人;存储工作邮箱
     */
    @TableField(fill = FieldFill.UPDATE)
    private String deletedBy;

    /**
     * 逻辑删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime deletedDatetime;

    /**
     * 逻辑删除标识
     */
    @TableField(fill = FieldFill.UPDATE)
    private Boolean deletedFlag;
}
